﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace Config.Controllers
{
    public class HomeController : Controller
    {
        private readonly MyConfig _config;

        public HomeController(IOptions<MyConfig> optionAccessor)
        {
            this._config = optionAccessor.Value;
        }
        public IActionResult Index()
        {
            ViewData["Config"] = _config.Key1 + "," + _config.Key2;
            return View();
        }
        public IActionResult About()
        {
            ViewData["Message"] = "Your application description page.";

            return View();
        }

        public IActionResult Contact()
        {
            ViewData["Message"] = "Your contact page.";

            return View();
        }

        public IActionResult Error()
        {
            return View();
        }
    }
}
